<template>
    <div>
        <ul>
            <li>
                <router-link to="/news/detail/1">狂飙</router-link>
            </li>
            <li>三体</li>
        </ul>
        <button @click="goHome()">首页</button>
        <button @click="goDetail(1)">狂飙</button>
    </div>
</template>

<script>
export default {
    name:'TvComponent',
    methods: {
        goHome:function(){
            
            // this.$router.push('/'); // 路径
            this.$router.push({name:'home'});
        },
        goDetail:function(id){
            console.log(id);
            this.$router.push({name:'newsdetail',params:{id:1},query:{name:'abc'}});
        }
    }
}
</script>